package com.mths.client.dto;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.google.gwt.user.client.rpc.IsSerializable;

public class DocMetaSearchDTO implements IsSerializable, Serializable {

	private static final long serialVersionUID = -8494258187242038532L;

	private List<MetaDataDTO> docReleatedMetaList;

	private List<MetaDataDTO> allMetaDataList;

	public DocMetaSearchDTO() {
		super();
	}

	public DocMetaSearchDTO(List<MetaDataDTO> docHasMetaDatas, List<MetaDataDTO> allMetaDatas) {
		super();
		this.docReleatedMetaList = docHasMetaDatas;
		this.allMetaDataList = allMetaDatas;
	}

	public List<MetaDataDTO> getDocReleatedMetaList() {
		if (docReleatedMetaList == null)
			docReleatedMetaList = new ArrayList<MetaDataDTO>();
		return docReleatedMetaList;
	}

	public void setDocReleatedMetaList(List<MetaDataDTO> docHasMetaDatas) {
		this.docReleatedMetaList = docHasMetaDatas;
	}

	public List<MetaDataDTO> getAllMetaDataList() {
		if (allMetaDataList == null)
			allMetaDataList = new ArrayList<MetaDataDTO>();
		return allMetaDataList;
	}

	public void setAllMetaDataList(List<MetaDataDTO> allMetaDatas) {
		this.allMetaDataList = allMetaDatas;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((allMetaDataList == null) ? 0 : allMetaDataList.hashCode());
		result = prime * result + ((docReleatedMetaList == null) ? 0 : docReleatedMetaList.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		DocMetaSearchDTO other = (DocMetaSearchDTO) obj;
		if (allMetaDataList == null) {
			if (other.allMetaDataList != null)
				return false;
		} else if (!allMetaDataList.equals(other.allMetaDataList))
			return false;
		if (docReleatedMetaList == null) {
			if (other.docReleatedMetaList != null)
				return false;
		} else if (!docReleatedMetaList.equals(other.docReleatedMetaList))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "DocumentMetaDTO [docHasMetaDatas=" + docReleatedMetaList + ", allMetaDatas=" + allMetaDataList + "]";
	}

}